<template>
	<view>
		<view class="horizontal">
			<view class="line"></view>
			<text class="regai">合作品牌</text>
		</view>

		<view class="box">
			<view class="box-item" v-for="(item,index) in data" :key="index">
				<view class="aling">
					<image :src="item.thumb"
						style="width: 280rpx;height: 168rpx;border-radius: 8rpx;" mode="widthfill"></image>
				</view>
				<view class="mark">
					<view style="text-align: center;font-weight: 800;color: white;
					line-height:168rpx;">{{item.name}}</view>
				</view>
			</view>

		</view>

		<view class="horizontal">
			<view class="line"></view>
			<text class="regai">楼盘套餐</text>
		</view>

		<view style="display: flex; flex-direction: row;">
			<view style="column">
				<image :src="list[1].thumb"
					style="width: 316rpx; margin-left: 40rpx;margin-top: 20rpx;display: block;border-radius: 10rpx 10rpx 0rpx 0rpx;"
					mode="widthfill"></image>
				<view class="tail">
					<text style="color: black;font-size: 38rpx;">{{list[1].name}}</text>
					<view style="display: flex; flex-direction: row;">
						<text style="color: black; font-size: 15rpx;">{{list[1].model}}m²</text>
						<text style="color: red; font-size: 40rpx;">&nbsp;&nbsp;￥{{list[1].price}}</text>
					</view>
					<text style="color: black; font-size: 15rpx;text-overflow: -o-ellipsis-lastline;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		-webkit-box-orient: vertical;">{{list[1].desc_str}}</text>
				</view>
			</view>
			<view style="column">
				<image :src="list[0].thumb"
					style="width: 316rpx; margin-left: 40rpx;margin-top: 20rpx;display: block;border-radius: 10rpx 10rpx 0rpx 0rpx;"
					mode="widthFill"></image>
				<view class="tail">
					<text style="color: black;font-size: 38rpx;">{{list[0].name}}</text>
					<view style="display: flex; flex-direction: row;">
						<text style="color: black; font-size: 15rpx;">{{list[0].model}}m²</text>
						<text style="color: red; font-size: 40rpx;">&nbsp;&nbsp;￥{{list[0].price}}</text>
					</view>
					<text style="color: black; font-size: 15rpx;">{{list[0].desc_str}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				data:[]
			}
		},
		onLoad() {
			uni.request({
				url: 'https://baiyi.kent.work/api/v1/system/getComboList',
				method: 'POST',
				data: {
					"page": 1,
					"limit": 10
				},
				success: res => {
					this.list = res.data.data.list
				},
				fail: () => {},
				complete: () => {}
			});
		 uni.request({
		 	url: 'https://baiyi.kent.work/api/v1/system/getBrandList',
		 	method: 'post',
		 	data: {},
		 	success: res => {
				console.log(res);
				this.data=res.data.data
			},
		 	fail: () => {},
		 	complete: () => {}
		 });
		}
	}
</script>
<style>
	::-webkit-scrollbar {
		display: none;
	}

	.line {
		display: inline-block; //取消单独占一行
		height: 28rpx;
		width: 6rpx;
		background-color: green;
		margin-left: 60rpx;
	}

	.regai {
		margin-left: 20rpx;
		font-weight: 600;
		font-size: 110%;
	}

	.horizontal {
		align-items: center;
		display: flex;
		margin-top: 28rpx;
		padding-top: 40rpx;
	}

	.box {
		// 这个表示x方向超出部分滚动处理
		overflow-x: scroll;
		display: flex;
		flex-direction: row;
		box-sizing: content-box;
	}

	.box-item {
		position: relative;
		margin-left: 40rpx;
	}

	.box-item:last-child {
		margin-right: 40rpx;
	}

	.aling {
		display: flex;
		box-sizing: border-box;
		margin-top: 28rpx;
		margin-bottom: 0rpx;
	}

	.column {
		display: flex;
		flex-direction: column;
	}

	.mark {
		position: absolute;
		left: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.1);
		width: 280rpx;
		height: 168rpx;
		border-radius: 8rpx;
		/* padding-left: 20rpx; */
	}

	.tail {
		background-color: white;
		width: 316rpx;
		/* height: 164rpx; */
		margin-left: 40rpx;
		border-bottom-right-radius: 10rpx;
		border-bottom-left-radius: 10rpx;
		display: flex;
		flex-direction: column;
	}
</style>